<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="cj20941">DROP MATERIALIZED VIEW</title>
  <body>
    <p id="sql_command_desc">Removes a materialized view.</p>
    <section id="section2">
      <title>Synopsis</title>
      <codeblock id="sql_command_synopsis">DROP MATERIALIZED VIEW [ IF EXISTS ] <varname>name</varname> [, ...] [ CASCADE | RESTRICT ]</codeblock>
    </section>
    <section id="section3"><title>Description</title><codeph>DROP MATERIALIZED VIEW</codeph> drops
      an existing materialized view. To run this command, you must be the owner of the
      materialized view.</section>
    <section id="section4">
      <title>Parameters</title>
      <parml>
        <plentry>
          <pt>IF EXISTS</pt>
          <pd>Do not throw an error if the materialized view does not exist. A notice is issued in
            this case. </pd>
        </plentry>
        <plentry>
          <pt><varname>name</varname></pt>
          <pd>The name (optionally schema-qualified) of a materialized view to be dropped. </pd>
        </plentry>
        <plentry>
          <pt>CASCADE</pt>
          <pd>Automatically drop objects that depend on the materialized view (such as other
            materialized views, or regular views). </pd>
        </plentry>
        <plentry>
          <pt>RESTRICT</pt>
          <pd>
            <p>Refuse to drop the materialized view if any objects depend on it. This is the
              default.</p>
          </pd>
        </plentry>
      </parml>
    </section>
    <section id="section6">
      <title>Examples</title>
      <p>This command removes the materialized view called <codeph>order_summary</codeph>.</p>
      <pre>DROP MATERIALIZED VIEW order_summary;</pre>
    </section>
    <section id="section7">
      <title>Compatibility</title>
      <p><codeph>DROP MATERIALIZED VIEW</codeph> is a Greenplum Database extension of the SQL
        standard.</p>
    </section>
    <section id="section8">
      <title>See Also</title>
      <p><codeph><xref href="ALTER_MATERIALIZED_VIEW.xml"/></codeph>, <codeph><xref
            href="CREATE_MATERIALIZED_VIEW.xml"/></codeph>, <codeph><xref
            href="REFRESH_MATERIALIZED_VIEW.xml"/></codeph></p>
    </section>
  </body>
</topic>
